// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;
import { Item } from "../Model/Model";

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Label)
    label_name: cc.Label = null;

    @property(cc.Label)
    label_amount: cc.Label = null;

    
    //text: string = 'hello';

    item:Item = null;
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}
    initItem(item:Item){
        this.item = item
        this.label_name.string = item.name
        this.label_amount.string = item.amount.toString()
        // 判断是否为武器，显示进度条
    }

    start () {

    }

    // update (dt) {}
}
